package com.xfanonymous.cloud.api;

import com.xfanonymous.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @auther xfanonymous
 * @create 2024-01-05 13:05
 *
 * 用于Feign+Sentinel整合
 * 1. @FeignClient() value指定服务端在Nacos中注册的服务名，fallback指定降级方法
 * 2. API接口方法就是服务端9001对外提供的handler
 * 3. 消费端通过FeignAPI方法调用消费端9001，当触发异常后，TODO:Feign统一提供fallback降级方法/类名
 */
@FeignClient(value = "nacos-payment-provider", fallback = PayFeignSentinelApiFallBack.class)
public interface PayFeignSentinelApi
{
    @GetMapping(value = "/pay/nacos/get/{orderNo}")
    public ResultData getPayByOrderNo(@PathVariable("orderNo") String orderNo);
}
